﻿@model PagedList.IPagedList<DoAnWebsite.Models.Document>
@using System.Globalization

@foreach (var item in Model)
{
    <div class="bv-Group left clearfix">
        <div class="left w160">
        @*<a href=@Url.Content("../.."+item.File)>
                <img src="../../Content/Image/DownloadLogo.png" height="100" width="100" alt="Ảnh Minh Họa" />
            </a>*@
            <div style="text-align: center;" >
                <a href=@Url.Action("DowbloadFile","Home",new {id=item.DocumentId})>
                    <img src="../../Content/Image/DownloadLogo.png" height="100" width="100" alt="Ảnh Minh Họa" />
                </a>
                <span><br/> @item.Download Download</span>
            </div>
        </div>
        <div class="right w425">
            <div style="margin-bottom: 10px;">
                @*<a href=@Url.Content("../.."+item.File)> @item.Name </a>*@
                <a href=@Url.Action("DowbloadFile","Home",new {id=item.DocumentId})>@item.Name</a>
            </div>
            <div>@Html.Raw(@item.Info)</div>                        
        </div>
    </div>
}
    <script>
        $(document).ready(function () {
            var page = @ViewBag.pageNumber;
            var id = "cmpage" + page;
            $(".pagingbar a").removeClass("active");
            $('#' + id).addClass('cmpageActive');
        });
    </script>
@if (Model.PageCount > 1)
{
    <div class="pagingbar">
        @Ajax.ActionLink("Đầu", "ListDocPartial", new {page = 1}, new AjaxOptions {UpdateTargetId = "listdoc"})
        @Ajax.ActionLink("<", "ListDocPartial", new {page = Model.PageNumber - 1}, new AjaxOptions {UpdateTargetId = "listdoc"})
        @for (int i = 1; i <= Model.PageCount; i++)
        {
            var page = i.ToString(CultureInfo.InvariantCulture);
            @Ajax.ActionLink(page, "ListDocPartial", new {page = i}, new AjaxOptions {UpdateTargetId = "listdoc"}, new {@id = "cmpage" + page})
        }
        @Ajax.ActionLink(">", "ListDocPartial", new {page = Model.PageNumber + 1}, new AjaxOptions {UpdateTargetId = "listdoc"})
        @Ajax.ActionLink("Cuối", "ListDocPartial", new {page = Model.PageCount}, new AjaxOptions {UpdateTargetId = "listdoc"})
    </div>
}